package com.erp.myAdapter

import android.annotation.SuppressLint
import android.content.Context
import android.content.SharedPreferences
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.BaseAdapter
import com.erp.R
import com.erp.bean.DuizhangBean
import com.erp.module.duizhangPhoto.DuizhangPhotoContract
import com.erp.util.Myutil
import com.erp.util.Sputil
import kotlinx.android.synthetic.main.lv_duizhang_item.view.*
import java.util.*

class DuizhangAdapter(var DuizhangList: MutableList<DuizhangBean>, var context: Context): BaseAdapter() {
    var minflater: LayoutInflater = LayoutInflater.from(context)
    @SuppressLint("ViewHolder", "InflateParams")
    override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
        var v : View =minflater.inflate(R.layout.lv_duizhang_item,null)
        val bean=DuizhangList[position]
        Myutil.settv(bean.year+"年"+bean.month+"月",v.Tv_Riqi)
        Myutil.settv(bean.shenhe(),v.Tv_Shenhe)
        return v
    }

    override fun getItem(position: Int): Any = DuizhangList[position]

    override fun getItemId(position: Int): Long = position.toLong()

    override fun getCount(): Int = DuizhangList.size
}